Amber's Digital Garden

FName Dropdowns in Unreal

An easy way to make dropdowns from arrays of FNames in Unreal


In the below, the variable inTeam on the function SetTeam() has a dropdown that is populated from the results of GetTeamNames(), and the variable Team has a dropdown that is populated from the results of GetTeamNames().

UFUNCTION(BlueprintCallable)  
void SetTeam(UPARAM(Meta=(GetOptions=GetTeamNames)) FName inTeam);  
  
UPROPERTY(EditAnywhere, BlueprintReadOnly, meta=(GetOptions=GetTeamNames), SaveGame)  
FName Team;  
  
UFUNCTION()  
static TArray<FName> GetTeamNames();

Inline for a function:

UPARAM(Meta=(GetOptions=<InplementationFunction>))

UPARAM Macro:

meta=(GetOptions=<InplementationFunction>)

by amber